package org.example.service;

import org.example.dao.AdminDAO;
import org.example.pojo.Admin;

import java.sql.SQLException;

public class AdminService {
    private AdminDAO adminDAO = new AdminDAO();

    public boolean register(String username, String password) {
        try {
            return adminDAO.register(username, password);
        } catch (SQLException e) {
            e.printStackTrace();
            return false;
        }
    }

    public Admin login(String username, String password) {
        try {
            return adminDAO.login(username, password);
        } catch (SQLException e) {
            e.printStackTrace();
            return null;
        }
    }
}
